﻿using System.Collections.Generic;

namespace Shared.Service.DataScopes.UserPolicyScopes
{
    /// <summary>
    /// 用户权限据范围
    /// </summary>
    public interface IUserPolicyDataScopeContext : IDataScopeContext<UserPolicyDataScope>
    {
        public string UserId { get;  }

        /// <summary>
        /// 名称
        /// </summary>
        public string PolicyName { get; }
    }

    public class UserPolicyDataScopeContext 
    {
        public UserPolicyDataScopeContext(string userId, string policyName, IEnumerable<UserPolicyDataScope> dataScopes)
        {
            UserId = userId;
            PolicyName = policyName;
            DataScopes = dataScopes;
        }

        /// <summary>
        /// 
        /// </summary>
        public string UserId { get; }
        
        /// <summary>
        /// 
        /// </summary>
        public string PolicyName { get; }

        /// <summary>
        /// 
        /// </summary>
        public IEnumerable<UserPolicyDataScope> DataScopes { get; }
    }
}
